from django.test import TestCase
from django.contrib.auth.models import User
from skillchallenge.models import *
from skillchallenge.game import *

class BaseViewTestCase(TestCase):
    config = None
    name = None
    location = None
    game = None
    
    def setUp(self):
        self.game = Game()
        self.game.config.max_skills = 3
        self.game.config.save()
        self.name = Name.objects.create(text='testchar')
        self.location = self.game.location_engine.create_location(name='testlocation', initial=True)
        user = User.objects.create_user('test', 'lennon@thebeatles.com', 'test')
 
    def __event_options__(self, event, options, debug=False):
        if debug: print options 
        return [option for option in options if option.event == event]